package edu.hawaii.nearestneighbor.tests;

import static org.junit.Assert.assertEquals;

import java.util.ArrayList;
import java.util.List;
import org.junit.Test;

import edu.hawaii.nearestneighbor.util.DataPoint;

/**
 * Test Suite for DataPoint class.
 * @author Robert Puckett
 */
public class TestDataPoint {

  /**
   * Test of the copy constructor.
   */
  @Test
  public void testCopy() {
    DataPoint p1 = new DataPoint();
    
    List < Double > alist = new ArrayList < Double >();
    alist.add(1.0);
    alist.add(2.0);
    alist.add(3.0);
    p1.state = 1;
    p1.x = alist;
    DataPoint p2 = new DataPoint(p1);
    p1.x.add(4.0);
    assertEquals("Test x's to make sure they are independent", p1.x.size() - 1, p2.x.size());
  }
}
